﻿<Controls:MetroWindow x:Class="NOnkyo.WpfGui.Views.RESTServerView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vm="clr-namespace:NOnkyo.WpfGui.ViewModels"
        xmlns:properties="clr-namespace:NOnkyo.WpfGui.AttachedProperty"
        Title="REST-Server" Height="300" Width="480" ShowIconOnTitleBar="false" ShowInTaskbar="false" ShowMinButton="false" ShowMaxRestoreButton="False">

    <Window.DataContext>
        <vm:RESTServerViewModel/>
    </Window.DataContext>

    <DockPanel Margin="4" LastChildFill="True">
        <StackPanel DockPanel.Dock="Top">
            <CheckBox Margin="3,6,3,3" IsChecked="{Binding StartOnlyLocal}">Start server only on localhost (if no you need admin privileges)</CheckBox>
            <CheckBox Margin="3,6,3,3" IsChecked="{Binding StartServerOnStartup}">Start server on startup</CheckBox>
            <StackPanel Orientation="Horizontal">
                <Label Content="Server-Port:"/>
                <TextBox Margin="3,6,3,3">
                    <Binding Path="Port" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" ValidatesOnDataErrors="True"/>
                </TextBox>
            </StackPanel>
            <Button x:Name="cmdStartServer" Content="StartServer"
                Margin="10"
                Style="{DynamicResource SquareButtonStyle}"
                Command="{Binding Path=StartServerCommand}"/>
            <Button x:Name="cmdStopServer" Content="StopServer"
                Margin="10"
                Style="{DynamicResource SquareButtonStyle}"
                Command="{Binding Path=StopServerCommand}" />
        </StackPanel>
        <StackPanel DockPanel.Dock="Bottom">
            <TextBlock Margin="5" >
                <Hyperlink IsEnabled="{Binding IsServerUrlSet}" NavigateUri="{Binding ServerUrl}" RequestNavigate="Hyperlink_RequestNavigate">Web-Interface</Hyperlink>
            </TextBlock>
        </StackPanel>
    </DockPanel>
</Controls:MetroWindow>